import './HomeHead.less'

import timg from '@/assets/images/timg.jpg'
import {useMemo} from "react";
const HomeHead = (props) => {
    let {timer} = props
    let time = useMemo(() => {
        let [, month, day] = timer.match(/^\d{4}(\d{2})(\d{2})$/),
            area = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
        return {
            month: area[+month] + '月',
            day
        };
    }, [timer]);
    return <header className='home-head-box'>


        <div className='info'>
            <div className={'time'}>
                <span>{time.day}</span>
                <span>{time.month}</span>
            </div>

            <h2 className={'title'}>哈哈哈哈</h2>
        </div>

        <div className='picture'>
            <img src={timg}  alt=''/>
        </div>
    </header>

};




export default HomeHead
